home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / vpi1_330.zip / EDBROW.PRG < prev    next >
Text File  |  1991-12-31  |  3KB  |  113 lines

  1. ***************************************************************************
  2. **  EDBROW.PRG
  3. **  (C) Copyright 1990-92, Sub Rosa Publishing Inc.
  4. **
  5. **  A demonstration program provided to VP-Info users.
  6. **  This program may be copied freely. If it is used in commercial code,
  7. **  please credit the source, Sub Rosa Publishing Inc.
  8. **
  9. **  EDBROW demonstrates the use of the EDIT and BROWSE commands in tandom to
  10. **  work on a file. The consistancy of keystrokes across the two commands
  11. **  makes this a very good approach to data management.
  12. **
  13. **  EDBROW is compatible with all current versions of VP-Info.
  14. **
  15. **  Sid Bursten and Bernie Melman
  16. ***************************************************************************
  17. SET func off ; we want the raw function keys - not the pre-loaded messages.
  18. ON escape
  19.    WINDOW
  20.    SET function on
  21.    CANCEL
  22. ENDON
  23. USE#1 members index members
  24. IF :color <> 7
  25.    SET color to 107; blue on brown
  26. ENDIF
  27. COLOR :color,0,0,24,79,177; fill screen with pattern
  28. * 177 is a shaded fill character.
  29. DO WHILE t; put main menu in an infinite loop
  30.    WINDOW 6,18,19,62 double; declare space for menu text
  31.    MODE = '?'
  32.    ERASE; fills window with blanks
  33.    TEXT
  34.  
  35.           Edit/Browse Demonstation
  36.  
  37.      0. Exit to Conversational VP-Info
  38.  
  39.      1. Choose a starting record.
  40.      2. Browse current record.
  41.      3. Edit current record.
  42.      4. Edit with custom screen.
  43.      5. Return to Main Samples Menu
  44.      6. Exit Info and return to DOS.
  45.    ENDTEXT
  46.    CURSOR 12,26 ; positions menu cursor over 1st character of 1st choice
  47.    SELECTION = menu(6,36); six choices menu bar width 36
  48.    DO CASE
  49.    CASE selection=0
  50.       WINDOW ;restore window to full screen
  51.       SET function on
  52.       CLS
  53.       CANCEL
  54.    CASE selection=1
  55.       PERFORM start_rec
  56.    CASE selection=2
  57.       mode='B'
  58.    CASE selection=3
  59.       mode='E'
  60.    CASE selection=4
  61.       WINDOW ; restore window to full screen
  62.       EDIT TEXT members  ; use 'painted' screen MEMBERS.TXT
  63.       mode='Q'
  64.       COLOR :color,0,0,24,79,177; re-fill screen with pattern
  65.    CASE selection=5
  66.       CHAIN samples
  67.    CASE selection=6
  68.       QUIT
  69.    ENDCASE
  70.    WINDOW 2,20
  71.    @ 22,5 say "PRESS F1 to toggle between BROWSE and EDIT."
  72.    @ 23,5 say "PRESS END to return to the main menu.      "
  73.    DO WHILE mode <> 'Q'
  74.       IF mode='E'
  75.          EDIT
  76.          IF :key=315
  77.             MODE = 'B'
  78.          ELSE
  79.             mode='Q'
  80.          ENDIF
  81.       ELSE
  82.          BROWSE
  83.          IF :key=315
  84.             MODE = 'E'
  85.          ELSE
  86.             mode='Q'
  87.          ENDIF
  88.       ENDIF
  89.    ENDDO
  90. ENDDO
  91. *
  92. *                   *** END OF EDBROW.PRG mainline code ***
  93. *
  94. PROCEDURE start_rec
  95.    CLEAR gets
  96.    mkey=blank(10)
  97.    ERASE
  98.    TEXT
  99. ENTER ESTIMATE OF LAST NAME -
  100.   up to 10 characters
  101.  LAST NAME: @mkey
  102.    ENDTEXT
  103.    READ
  104.    MKEY = !(trim(mkey)) ; get rid of trailing blanks
  105.    FIND &mkey
  106.    IF #=0 ; no find - so go to next record
  107.       GOTO :near
  108.    ENDIF
  109. ENDPROCEDURE; start_rec
  110. *
  111. *
  112. *                      *** end of EDBROW.PRG ***
  113.